package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PharmacyMapper;
import com.ruoyi.system.domain.Pharmacy;
import com.ruoyi.system.service.IPharmacyService;

/**
 * 药品库存Service业务层处理
 * 
 * @author 墨白
 * @date 2024-08-11
 */
@Service
public class PharmacyServiceImpl implements IPharmacyService 
{
    @Autowired
    private PharmacyMapper pharmacyMapper;

    /**
     * 查询药品库存
     * 
     * @param medicineId 药品库存主键
     * @return 药品库存
     */
    @Override
    public Pharmacy selectPharmacyByMedicineId(Long medicineId)
    {
        return pharmacyMapper.selectPharmacyByMedicineId(medicineId);
    }

    /**
     * 查询药品库存列表
     * 
     * @param pharmacy 药品库存
     * @return 药品库存
     */
    @Override
    public List<Pharmacy> selectPharmacyList(Pharmacy pharmacy)
    {
        return pharmacyMapper.selectPharmacyList(pharmacy);
    }

    /**
     * 新增药品库存
     * 
     * @param pharmacy 药品库存
     * @return 结果
     */
    @Override
    public int insertPharmacy(Pharmacy pharmacy)
    {
        return pharmacyMapper.insertPharmacy(pharmacy);
    }

    /**
     * 修改药品库存
     * 
     * @param pharmacy 药品库存
     * @return 结果
     */
    @Override
    public int updatePharmacy(Pharmacy pharmacy)
    {
        return pharmacyMapper.updatePharmacy(pharmacy);
    }

    /**
     * 批量删除药品库存
     * 
     * @param medicineIds 需要删除的药品库存主键
     * @return 结果
     */
    @Override
    public int deletePharmacyByMedicineIds(Long[] medicineIds)
    {
        return pharmacyMapper.deletePharmacyByMedicineIds(medicineIds);
    }

    /**
     * 删除药品库存信息
     * 
     * @param medicineId 药品库存主键
     * @return 结果
     */
    @Override
    public int deletePharmacyByMedicineId(Long medicineId)
    {
        return pharmacyMapper.deletePharmacyByMedicineId(medicineId);
    }
}
